package cn.stylefeng.guns.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
public class OssConfig {
    @Value("${aliyun.file.endpoint}")
    private  String endpoint;
    @Value("${aliyun.file.accessKeyId}")
    private  String accessKeyId;
    @Value("${aliyun.file.accessKeySecret}")
    private  String accessKeySecret;
    @Value("${aliyun.file.bucketName}")
    private  String bucketName;
    @Value("${aliyun.file.webUrl}")
    private  String webUrl;

    @Bean
    public OSS oSSClient() {
        return new OSSClient(endpoint, accessKeyId, accessKeySecret);
    }
}
